package com.qd.common.flow.domain.bill;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 审批任务
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class FlowTaskDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "任务ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "任务ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String taskId;
    /**
     * 创建时间
     */
    private LocalDateTime createTime;
    /**
     * 节点名称
     */
    @Size(max = 100, message = "节点名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String nodeName;
    /**
     * 审批人
     */
    @Size(max = 100, message = "审批人长度不能超过{max}位", groups = DefaultGroup.class)
    private String approvalName;
    /**
     * 审批人所在单位
     */
    @Size(max = 100, message = "审批人所在单位长度不能超过{max}位", groups = DefaultGroup.class)
    private String approvalOrgName;
    /**
     * 审批部门
     */
    @Size(max = 100, message = "审批部门长度不能超过{max}位", groups = DefaultGroup.class)
    private String approvalDepartName;
    /**
     * 审批业务ID
     */
    @NotBlank(message = "审批业务ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "审批业务ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String billId;
    /**
     * 审批人所在单位ID
     */
    @NotBlank(message = "审批人所在单位ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "审批人所在单位ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String approvalOrg;
    /**
     * 审批人ID
     */
    @Size(max = 50, message = "审批人ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String approval;
    /**
     * 审批部门ID
     */
    @NotBlank(message = "审批部门ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "审批部门ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String approvalDepart;
    /**
     * 节点ID
     */
    @NotBlank(message = "节点ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "节点ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String nodeId;
    /**
     * 流程ID
     */
    @NotBlank(message = "流程ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "流程ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String processId;

    @Override
    public void freeData() {
        this.taskId = null;
        this.createTime = null;
        this.nodeName = null;
        this.approvalName = null;
        this.approvalOrgName = null;
        this.approvalDepartName = null;
        this.billId = null;
        this.approvalOrg = null;
        this.approval = null;
        this.approvalDepart = null;
        this.nodeId = null;
        this.processId = null;
        super.freeData();
    }
}
